<div id='sidebar'>

  <div class='panel'>
    <% if (typeof(user) !== 'undefined' || typeof(current_user) !== 'undefined') { %>
    <div class='header'>
      <span class='col_fade'>个人信息</span>
    </div>
    <div class='inner'>
      <%- partial('user/card',{ object: typeof(user) === 'undefined' ? current_user : user, as: 'user' }) %>
    </div>
    <% } else { %>
    <div class='inner'>
      <p><%= config.description %></p>

      <div>
        您可以
        <a href='/signin'>登录</a>
        或
        <a href='/signup'>注册</a>
<!--         , 也可以
        <a href="/auth/github">
          <span class="span-info">
            通过 GitHub 登录
          </span>
        </a> -->
      </div>
    </div>
    <% } %>
  </div>

  <% if (typeof(current_user) !== 'undefined') { %>
  <div class="panel">
    <div class='inner'>
      <a href='/modules/schedule/create' id='create_topic_btn'>
        <span class='span-success'>创建规划任务</span>
      </a>
    </div>
  </div>
  <% } %>

  <% if (typeof(current_user) === 'undefined' || !current_user.isAdvanced) { %>
    <%- partial('./_ads') %>
  <% } %>

  <% if (typeof(no_reply_topics) !== 'undefined') { %>
  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>无人回复的记录</span>
    </div>
    <div class='inner'>
      <% if (no_reply_topics.length > 0) { %>
      <ul class="unstyled">
        <%- partial('schedule/small', { collection: no_reply_topics, as: 'topic' }) %>
      </ul>
      <% } else { %>
      <p>无</p>
      <% } %>
    </div>
  </div>
  <% } %>

  <% if (typeof(tops) !== 'undefined') { %>
  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>贡献率</span>
      &nbsp;
      <a class='dark' href='/users/top100'>前 100 名员工&gt;&gt;</a>
    </div>
    <div class='inner'>
      <% if (tops.length > 0) { %>
      <ol>
        <%- partial('user/top', { collection: tops, as: 'user' }) %>
      </ol>
      <% } else { %>
      <p>无</p>
      <% } %>
    </div>
  </div>
  <% } %>

  <div class='panel'>
    <div class='header'>
      <span class='col_fade'>常用链接</span>
    </div>
    <div class='inner'>
      <ol class="friendship-community">
        <li>
          <a href="/about" target="_blank">
            金矢科技 资产管理系统
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="#" target="_blank">
            公司首页
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="#" target="_blank">
            企业ERP
          </a>
        </li>
        <div class="sep10"></div>
        <li>
          <a href="#" target="_blank">
          员工帮助中心
          <!-- to use an image -->
           <!--  <img src="<%- staticFile('/public/images/phphub-logo.png') %>"> -->
          </a>
        </li>
      </ol>
    </div>
  </div>

</div>
